package com.sc.design.visitor;

/**
 * @author sc
 * Created on  2017/12/7
 */
public class Visitor implements IVisitor{

    private String getManagerInfo(ManagerEmployee managerEmployee){
        return managerEmployee.getName()+managerEmployee.getSalary()+managerEmployee.getPerformance();
    }
    private String getCommonInfo(CommonEmployee commonEmployee){
        return commonEmployee.getName()+commonEmployee.getJob();
    }
    @Override
    public void visit(CommonEmployee commonEmployee) {
        System.out.println(this.getCommonInfo(commonEmployee));
    }

    @Override
    public void visit(ManagerEmployee managerEmployee) {
        System.out.println(this.getManagerInfo(managerEmployee));
    }
}
